programming4us
           
 
 
Applications Server

BizTalk 2009 : Using XML Namespaces (part 2) - Using Port Filters and Content-Based Routing

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
8/11/2011 11:54:24 AM

2. Using Port Filters and Content-Based Routing

As stated in the previous section, subscriptions and context properties are integral to the messaging subsystem. Property schemas are the mechanism by which the context properties or message data values are stored in the message context. Besides the properties promoted by a developer, the BizTalk Message Bus also automatically promotes system-level properties from the system property namespaces, depending on the type of inbound and outbound transports that are being used. Each adapter will stamp its specific values into context properties that then become available to subscribers to act upon.

Most people new to BizTalk don't understand how messages are routed within the product or how to use the property schemas to affect the subscription. Exercise 1 will show you how you can use the property promotion to implement routing logic.

EXERCISE 1: USING CUSTOM PROMOTED PROPERTIES TO ROUTE MESAGES

Assume that there are three systems: a web site, a POS application, and an automated FTP upload location. Each of these locations takes a different schema and must map it to internal schema. This mapped message then needs to be sent to the ERP system. However, as an added piece of functionality, documents from the web site need to be sent to a separate location as well, and documents from the POS system need to be sent to a file system directory so they can be batch uploaded at a later time. Figures 1 and 2 define the schema for the internal messages and a possible solution architecture.

Figure 1. Internal order request schema

The requirements for this solution are quite common in most BizTalk projects, and most new BizTalk architects design it incorrectly. Generally those unfamiliar with the subscription nature of the Message Bus will tend to build an orchestration that has logical ports directly bound to the physical ports. The orchestration would then use Decide shapes to send the message to the appropriate send port, which will then send the message on its way. An even worse solution is to create three orchestrations, each of which receives the inbound message directly from the receive location, executes the map from within the orchestration, and then has a static bound port that is bound to the send port from within the orchestration. This problem requires only messaging to be solved. No orchestrations should be created here since no business logic is needed. Routing the message to the correct location is not business logic, and as such, an orchestration is not the correct tool to use from the BizTalk Server toolbox.

Figure 2. Solution architecture

To implement the routing logic, subscriptions need to be created that allow the inbound message, once it has been mapped, to be sent to the correct port. Here, you create filters based on the MessageType context property that allow the Messaging Engine to automatically forward any messages of type http://ABC.FulFillment.BizTalk.Schemas.OrderSchema#Order to the adapter, which communicates with the ERP system. The filter of the port will modify the subscription in the Messagebox accordingly. In the filter properties of the ERPSendPort, the expression shown in Figure 3 will be present.

You still have not seen how to solve the problem of differentiating messages that are received from each of the three separate order-producing systems. Notice that the internal schema definition includes an element that will allow you to store that data should it be available, but there are two problems: how you get the value in this element and how you route messages based on it. For adding this value into the data document, you use the inbound map defined on the receive port. All you need to do is create a map from the external schema to the internal schema and assign a constant value for the SourceSystem element.

To allow you to route on the SourceSystem property, you need to create a property schema to define what properties you want to store in the context and to allow the Messaging Engine to promote the value from the data in your inbound document. To do this, add a new item to the schema project: in the list of BizTalk project items, choose Property Schema. Add an attribute to the schema called SourceSystem, as shown in Figure 4.

Figure 3. ERPSendPort properties

Figure 4. Web site to internal schema map

Figure 5 shows the schema for the internal order property schema as viewed in the BizTalk schema editor.

Figure 5. Order property schema

The next step is to associate the custom property schema to the internal order schema. To do this, right-click the SourceSystem element in the internal order property schema, and choose Promotions => Show Promotions, as demonstrated in Figure 6. Next, click the Promoted Properties tab, and click the open folder icon.

Figure 6. Type Picker dialog box

Once you have chosen OrderPropertySchema, highlight the SourceSystem element on the left, and click the Add>> button. This will add the element to the list of promoted properties. Notice that since there is only one property defined in the property schema, the editor automatically associates this field with the SourceSystem property in the property schema, as shown in Figure 7.

Figure 7. Manually promoting the SourceSystem property

Compile the project and deploy it to the Management Database. Once the property schema's assembly is deployed to the Management Database, it will automatically be available in the list of properties in a ports filter. If you create a new send port and want to only send documents from the web site, you can add its SourceSystem property as a filter, and this will automatically update the subscription, as shown in Figure 8.

Another important fact to note is that in this situation, you need to create only one receive port with three receive locations. You also need to create three maps and add them each to the transforms on the port. The pipeline will examine the inbound schema for each map and send the inbound document to the correct map. If no port has a subscription for a matching inbound message type, an error will occur, and the message will become suspended.

Figure 8. Routing based on a custom promoted property
Other -----------------
- BizTalk 2009 : Understanding the Message Bus
- Active Directory Domain Services 2008 : Determine Global Catalog Servers
- BizTalk Server 2006 Operations : Disaster Recovery
- Configuring and Using Active Directory Rights Management Services
- Microsoft Dynamics GP 2010 : Installing the Dynamics GP 2010 application
- Microsoft Dynamics GP 2010 : Installing Microsoft SQL Server for Dynamics GP
- Starting a New BizTalk 2009 Project : BizTalk Naming Conventions
- Starting a New BizTalk 2009 Project : BizTalk Assembly Naming and Versioning
- Microsoft Dynamics AX 2009 : Working with Forms - Adding form splitters
- Microsoft Dynamics AX 2009 : Working with Forms - Building dynamic form
- Starting a New BizTalk 2009 Project : Creating a Build-and-Integration Environment (part 2) - Using Test-Driven Development & Creating a BizTalk Installation Package
- Starting a New BizTalk 2009 Project : Creating a Build-and-Integration Environment (part 1) - Five-Step Build Process
- Exchange Server 2010 : Manage Database Redundancy (part 3) - Manage Database Availability
- Exchange Server 2010 : Manage Database Redundancy (part 2) - Manage Database Replication
- Exchange Server 2010 : Manage Database Redundancy (part 1) - Configure Redundant Databases
- Extending Microsoft Dynamics CRM 4.0 : Customization Options by CRM Version & Customizing Navigation
- Extending Microsoft Dynamics CRM 4.0 : Limitations and Licensing Considerations
- Microsoft Dynamics AX 2009 : Working with Forms - Creating dynamic menu buttons
- Microsoft Dynamics AX 2009 : Working with Forms - Handling dialog events
- Microsoft Dynamics AX 2009 : Working with Forms - Creating Dialogs
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us